package com.zjgxzh.agentservice.mapper;

import com.zjgxzh.agentservice.pojo.Agent;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AgentMapper {

    @Select("SELECT * FROM agent WHERE username = #{username}")
    List<Agent> findAgentByUsername(String username);

    @Insert("INSERT INTO agent (assistant_id, description, icon, username, thread_id) VALUES (#{assistantId},#{description},#{icon},#{username},#{threadId})")
    void addAgent(Agent agent);
}
